<?php

namespace Admin\Controller;

class FriendController extends AdminController {
	public function index(){
		$this->display();
	}
	public function add(){
		if (IS_POST) {
			$friend=D('Friend');
			$res=$friend->create();
        if ($res) {
        	if ($friend->add()) {
        		$this->success('nice');
        	}else{
        		$this->error('失败');
        	}
        }else{
                $this->error($friend->getError());
        }
		}else{
			$this->meta_title = '新增友链';
            $this->display();
		}
	}
}